package com.example.response;

import org.json.JSONException;
import org.json.JSONObject;

import com.example.network.Response;
import com.example.resource.RequestFieldFromServer;

/**
 * 登陆请求后的响应
 * 
 * @author TangChao
 */
public class LoginResponse extends Response
{
	public RequestFieldFromServer field;
	
	@Override
	protected void jsonToObject()
	{
		field = new RequestFieldFromServer();
		try
		{
			JSONObject jsonObject = reposonJson.getJSONObject("result");
			field.code = jsonObject.optInt("code");
			field.message = jsonObject.optString("message");
			field.status = jsonObject.optString("status");
			field.appKey = jsonObject.optString("appKey");
		}
		catch (JSONException e)
		{
			e.printStackTrace();
		}
	}
}
